#include "../common/psserver.h"
#include "../common/gnwclient.h"
#include "../common/psmonitor.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/resource.h>

void		DealCommand(IPSClientContext* p, CmdHead* head);
IPSClient*	CreateClient(int sock, IPSMonitor* mon);

int main(void)
{
	CPSMonitor		mon;
	CPSServer		svr(&mon, CreateClient);
	rlimit			rt;

	rt.rlim_cur = 65535;
	rt.rlim_max = 65535;
	setrlimit(RLIMIT_NOFILE, &rt);

	svr.Start(6688, 0);

	signal(SIGPIPE,SIG_IGN);
	mon.Run();
	return 0;
}

IPSClient* CreateClient(int sock, IPSMonitor* mon)
{
	return CGnwClient::Create(sock, mon, DealCommand);
}

void DealCommand(IPSClientContext* p, CmdHead* head)
{
	
}

